<template>
	<page-body>
		<view class="page">
			<view :class="bbb ? 'mine_flex_0_other' : ''"
				class="flex benben-position-layout flex flex-wrap align-center mine_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub mine_fd0_0'>
					<view class='flex flex-wrap align-center mance_fd0_0_c0'>
						<text class='fu-iconfont2  mance_fd0_0_c0_c0' @tap.stop="handleJumpDiy" data-type="back"
							data-url="1">&#xE794;</text>
					</view>

					<view class='flex flex-wrap align-stretch justify-center'>
						<text class='mine_fd0_0_c1_c0'>学习统计</text>
					</view>
					<view class='flex flex-wrap align-center justify-end mine_fd0_0_c2'></view>
				</view>
			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex benben-flex-layout flex-wrap align-center mine_flex_1">
				<image class='mine_fd1_0' mode="aspectFill" :src='UserInfo.avatar'></image>
				<view class='flex flex-wrap align-center justify-between flex-sub mine_fd1_1'>
					<view class='flex flex-direction flex-wrap align-stretch mine_fd1_1_c0' @tap.stop="handleJumpDiy"
						data-type="navigateTo" :data-url="`/pages/Mymine/Mydata/Mydata`">
						<text class='flex-sub mine_fd1_1_c0_c0'>{{UserInfo.real_name}}</text>
						<text class='mine_fd1_1_c0_c1'>共签到<text class="number">{{ resObj.sign_in_count }}</text>次
							<text class='fu-iconfont2  mine_fd1_1_c1' @tap.stop="handleJumpDiy" data-type="navigateTo"
								:data-url="`/pages/Mymine/Mydata/Mydata`">&#xe7f2;</text></text>
					</view>
				</view>
			</view>

			<view class="content-outer01">
				<view class="item" @tap.stop="handleJumpDiy" data-type="navigateTo"
						:data-url="`/pages/kc/kczj/kczj?course=${kcid}`">
					<image class="item-icon" src="@/static/studyTotal/01.png" mode=""></image>
					<text class="name">章节学习</text>
					<view class="num-outer">
						<text class="num">{{resObj.chapter_study?resObj.chapter_study.progress:''}}</text>
						<image class="right-icon" src="@/static/studyTotal/right.png" mode=""></image>
					</view>
					<view class="ranking">
						进度排名：{{ resObj.chapter_study?resObj.chapter_study.rank:'' }}
					</view>
				</view>
				<view class="item">
					<image class="item-icon" src="@/static/studyTotal/2.png" mode=""></image>
					<text class="name">章节测验</text>
					<view class="num-outer">
						<text class="num">{{resObj.chapter_quiz?resObj.chapter_quiz.progress:'' }}</text>
						<image class="right-icon" src="@/static/studyTotal/right.png" mode=""></image>
					</view>
				</view>
				<view class="item">
					<image class="item-icon" src="@/static/studyTotal/3.png" mode=""></image>
					<text class="name">观看视频</text>
					<view class="num-outer" @tap.stop="handleJumpDiy" data-type="navigateTo"
						:data-url="`/pages/kc/kczy/kczy?course=${kcid}`">
						<text class="num">{{ resObj.video_watch_time }}分钟</text>
						<image class="right-icon" src="@/static/studyTotal/right.png" mode=""></image>
					</view>
				</view>
				<view class="item item-bottom">
					<image class="item-icon" src="@/static/studyTotal/4.png" mode=""></image>
					<text class="name">章节学习次数</text>
					<view class="num-outer" @tap.stop="handleJumpDiy" data-type="navigateTo"
						:data-url="`/pages/kc/kczj/kczj?course=${kcid}`">
						<text class="num">{{ resObj.chapter_study_count }}</text>
						<image class="right-icon" src="@/static/studyTotal/right.png" mode=""></image>
					</view>
				</view>
			</view>

			<view class="content-outer01 content-outer02">
				<view class="item">
					<image class="item-icon" src="@/static/studyTotal/5.png" mode=""></image>
					<text class="name">作业</text>
					<view class="num-outer" @tap.stop="handleJumpDiy" data-type="navigateTo"
						:data-url="`/pages/kc/khzy/khzy?course=${kcid}`">
						<text class="num">{{ resObj.homework?resObj.homework.progress:'' }}</text>
						<image class="right-icon" src="@/static/studyTotal/right.png" mode=""></image>
					</view>
				</view>
				<view class="item item-bottom">
					<image class="item-icon" src="@/static/studyTotal/6.png" mode=""></image>
					<text class="name">考试</text>
					<view class="num-outer" @tap.stop="handleJumpDiy" data-type="navigateTo"
						:data-url="`/pages/exam/examList/examList?course=${kcid}`">
						<text class="num">{{ resObj.exam?resObj.exam.progress:'' }}</text>
						<image class="right-icon" src="@/static/studyTotal/right.png" mode=""></image>
					</view>
				</view>
			</view>

			<view class="content-outer01 content-outer03">
				<view class="item-03">
					<view class="item-top">
						<image class="item-icon" src="@/static/studyTotal/7.png" mode=""></image>
						<text class="name">知识图谱</text>
						<view class="num-outer">
							<image class="right-icon" src="@/static/studyTotal/right.png" mode=""></image>
						</view>
					</view>


					<view class="item-content">
						<view class="content-item">
							<view class="item-num">
								{{resObj.knowledge_graph?resObj.knowledge_graph.learning_progress:''}}
							</view>
							<view class="item-name">
								学习进度
							</view>
						</view>
						<view class="content-item">
							<view class="item-num">
								{{resObj.knowledge_graph?resObj.knowledge_graph.completion_rate:''}}%
							</view>
							<view class="item-name">
								知识点平均
								完成率
							</view>
						</view>
						<view class="content-item">
							<view class="item-num">
								{{resObj.knowledge_graph?resObj.knowledge_graph.mastery_rate:''}}%
							</view>
							<view class="item-name">
								知识点平均
								掌握率
							</view>
						</view>
					</view>
				</view>
		<!-- 		<view class="item-03">
					<view class="item-top">
						<image class="item-icon" src="@/static/studyTotal/8.png" mode=""></image>
						<text class="name">讨论</text>
						<view class="num-outer">
							<image class="right-icon" src="@/static/studyTotal/right.png" mode=""></image>
						</view>
					</view>


					<view class="item-content">
						<view class="content-item">
							<view class="item-num">
								55/85
							</view>
							<view class="item-name">
								学习进度
							</view>
						</view>
						<view class="content-item">
							<view class="item-num">
								64%
							</view>
							<view class="item-name">
								回复数
							</view>
						</view>
						<view class="content-item">
							<view class="item-num">
								80%
							</view>
							<view class="item-name">
								获赞数
							</view>
						</view>
					</view>
				</view> -->
			</view>
		</view>
	</page-body>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},


		data() {
			return {
				"num": '', //错题数量
				"aid": '',
				"resObj": {},
				"bbb": false,
				"UserInfo": {
					"id": "",
					"nickname": "",
					"baseclass_name": "",
					"basemajor_name": "",
					"avatar": "",
					"real_name": "",
					"gender": "",
					"mobile": "",
					"birthday": "",
					"baseclass_grade": "",
					"political_status_name": "",
					"account": "",
					"basedept_name": "",
					"degree_name": "",
					"degree": "",
          kcid:''
				}
			};
		},
		computed: {

		},
		watch: {},
		onLoad(options) {
			this.aid = options.aid
      this.kcid = options.kcid
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			this.getck6f4cf3a2bf31Func()
			this.get_learn_total()
		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {
			if (e.scrollTop >= 10) {
				this.bbb = true
			} else {
				this.bbb = false
			}
		},
		methods: {
			jump(val) {
				if (!val) {
					this.$message.info('暂无错题')
					return
				}
				// this.$urouter.navigateTo(`/pages/Mymine/aiSeart/aiSeart`);
				uni.navigateTo({
					url: "/pages/tabBar/wrongQuestion/wrongQuestion?type=2"
				})
			},
			soundRecording() {
				this.$urouter.navigateTo(`/pages/Mymine/aiSeart/aiSeart`);

			},
			async get_learn_total() {
				let res = await this.$api.get(global.apiUrls.post6923f467894f8, {
					knowledgepoints_id: this.aid
				});

				if (res.data.code != 1) {
					this.$message.info(res.data.msg);
					return
				}
				this.resObj = res.data.data
				console.log('.....................', this.resObj);
			},
			//APP接口-我的画像-个人信息
			async getck6f4cf3a2bf31Func() {
				//请求方法
				//数据验证

				let dataUserInfo = await this.$api.get(global.apiUrls.post66f4cf3a2bf31, {

				});

				if (dataUserInfo.data.code != 1) {
					this.$message.info(dataUserInfo.data.msg);
					return
				}
				let infoUserInfo = dataUserInfo.data;
				this.UserInfo = infoUserInfo.data

				//错题数量
				const res1 = await this.$api.get(global.apiUrls.post67735544acf41, {});
				this.num = res1.data.data.count
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		overflow-y: auto;
		background: url(image-path('1597.png')) no-repeat;
		background-size: 100% auto;
	}

	.content-outer01 {
		margin: 0 24rpx;
		height: 483rpx;
		background: #FFFFFF;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		border: 2rpx solid #FFFFFF;

		.item {
			height: 120rpx;
			padding: 0 24rpx;
			display: flex;
			align-items: center;
			position: relative;
			border-bottom: 1rpx solid #EEEEEE;

			.item-icon {
				width: 64rpx;
				height: 64rpx;
				margin-right: 20rpx;
			}

			.name {
				font-weight: 400;
				font-size: 30rpx;
				color: #333333;
				line-height: 42rpx;
			}

			.num-outer {
				position: absolute;
				right: 24rpx
			}


			.ranking {
				font-weight: 400;
				font-size: 24rpx;
				color: #FD762E;
				line-height: 33rpx;
				padding: 10rpx 20rpx;
				background: linear-gradient(180deg, #FFF7F2 0%, #FDF1EA 100%);
				border-radius: 26rpx 26rpx 26rpx 26rpx;
				position: absolute;
				right: 150rpx;
			}


			.right-icon {
				width: 22rpx;
				height: 22rpx;
				margin-left: 12rpx;
			}

			.num-outer {
				display: inline-block;

				.num {
					font-weight: 400;
					font-size: 30rpx;
					color: #333333;
					line-height: 42rpx;
				}
			}
		}

		.item-bottom {
			border-bottom: none;
		}
	}

	.content-outer02 {
		height: 241rpx;
		margin-top: 24rpx;
	}

	.content-outer03 {
		height: 556rpx;
		margin-top: 24rpx;

		.item-03 {
			height: 296rpx;
			padding: 0 24rpx;
			position: relative;
			// border-bottom: 1rpx solid #EEEEEE;

			.item-icon {
				width: 64rpx;
				height: 64rpx;
				margin-right: 20rpx;
			}

			.name {
				font-weight: 400;
				font-size: 30rpx;
				color: #333333;
				line-height: 42rpx;
			}

			.num-outer {
				position: absolute;
				right: 24rpx
			}


			.ranking {
				font-weight: 400;
				font-size: 24rpx;
				color: #FD762E;
				line-height: 33rpx;
				padding: 10rpx 20rpx;
				background: linear-gradient(180deg, #FFF7F2 0%, #FDF1EA 100%);
				border-radius: 26rpx 26rpx 26rpx 26rpx;
				position: absolute;
				right: 150rpx;
			}


			.right-icon {
				width: 22rpx;
				height: 22rpx;
				margin-left: 12rpx;
			}

			.num-outer {
				display: inline-block;

				.num {
					font-weight: 400;
					font-size: 30rpx;
					color: #333333;
					line-height: 42rpx;
				}
			}
		}

		.item-top {
			display: flex;
			position: relative;
			margin-top: 26rpx;
			align-items: center;

		}

		.item-content {
			width: 100%;
			margin-top: 30rpx;
			display: flex;
			justify-content: space-between;

			.content-item {
				width: 130rpx;

				.item-num {
					font-weight: 400;
					font-size: 30rpx;
					color: #333333;
					line-height: 42rpx;
					text-align: center;
				}

				.item-name {
					font-weight: 400;
					font-size: 26rpx;
					color: #666666;
					line-height: 37rpx;
					text-align: center;
					margin-top: 20rpx;
				}
			}
		}
	}


	.mine_flex_0 {
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-color: rgba(255, 255, 255, 0);
	}

	.mine_flex_0_other {
		background-color: rgba(255, 255, 255, 1);
	}

	.mine_fd0_0_c2_c1 {
		position: absolute;
		top: -15rpx;
		right: -15rpx;
	}

	.mine_fd0_0_c2_c0 {
		width: 40rpx;
		height: 40rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.mine_fd0_0_c2 {
		width: 120rpx;
		position: relative;
	}

	.mine_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 700;
		color: #333333;
		line-height: 50rpx;
	}

	.mine_fd0_0_c0 {
		width: 120rpx;
	}

	.mine_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.mine_flex_1 {
		padding: 0rpx 24rpx 0rpx 24rpx;
		margin: 55rpx 0rpx 46rpx 0rpx;
	}

	.mine_fd1_1_c1 {
		font-size: 22rpx;
		color: rgba(51, 51, 51, 1);
		margin-left: 12rpx;
	}

	.mine_fd1_1_c0_c1 {
		color: #666666;
		font-size: 26rpx;
		font-weight: 400;
		line-height: 37rpx;

		.number {
			color: #145EFD;
			margin: 0 10rpx 0 10rpx;
		}
	}

	.mine_fd1_1_c0_c0 {
		margin: 0rpx 0rpx 16rpx 0rpx;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		color: rgba(51, 51, 51, 1);
		font-weight: 500;
		font-size: 36rpx;
		color: #333333;
		line-height: 50rpx;
	}

	.mine_fd1_1_c0 {
		width: 500rpx;
		display: flex;
		flex-direction: column;
	}

	.mine_fd1_1 {
		margin: 0rpx 0rpx 0rpx 0rpx;
	}

	.mine_fd1_0 {
		width: 96rpx;
		height: 96rpx;
		border-radius: 58rpx;
		margin: 0rpx 20rpx 0rpx 0rpx;
	}

	.mine_flex_2 {
		padding: 0rpx 24rpx 0rpx 24rpx;
	}

	.mine_fd2_0_c0_c1 {
		color: rgba(102, 102, 102, 1);
		text-align: center;
	}

	.mine_fd2_0_c0_c0 {
		text-align: center;
		color: #333;
		font-size: 44rpx;
		font-weight: 600;
		line-height: 62rpx;
	}

	.mine_fd2_0_c0 {
		height: 100%;
		width: 200rpx;
	}

	.mine_fd2_0 {
		background: var(--benbenbgColor1);
		width: 100%;
		height: 175rpx;
		background-size: 100% auto;
		border-radius: 16rpx;
		padding: 32rpx;
	}

	.mine_flex_3 {
		padding: 24rpx 24rpx 24rpx 24rpx;
	}

	.mine_fd3_0_c3 {
		margin: 0rpx 0rpx 32rpx 0rpx;
		width: 120rpx;
	}

	.mine_fd3_0_c1_c1 {
		font-size: 24rpx;
		font-weight: 500;
		color: #333333;
		margin: 16rpx 0rpx 0rpx 0rpx;
		max-width: 120rpx;
		line-height: 33rpx;
	}

	.mine_fd3_0_c0_c1 {
		font-size: 24rpx;
		font-weight: 500;
		color: #333333;
		margin: 16rpx 0rpx 0rpx 0rpx;
		max-width: 96rpx;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		line-height: 33rpx;
	}

	.mine_fd3_0_c0_c0 {
		width: 56rpx;
		height: 56rpx;
	}

	.mine_fd3_0_c0 {
		margin: 0rpx 30rpx 32rpx 0rpx;
		width: 120rpx;
	}

	.mine_fd3_0 {
		background: var(--benbenbgColor1);
		padding: 40rpx 45rpx 0rpx 45rpx;
		background-size: 100% auto;
		border-radius: 24rpx;
	}

	.mine_flex_4 {
		padding: 0rpx 24rpx 0rpx 24rpx;
	}

	.mine_fd4_0 {
		width: 100%;
		height: 300rpx;
		border-radius: 16rpx;
	}
</style>